ASP.NET4.0错误:Operation is not valid due to the current state of the object

您所在的位置:网站首页 虚拟机operation inconsistent with current state ASP.NET4.0错误:Operation is not valid due to the current state of the object

ASP.NET4.0错误:Operation is not valid due to the current state of the object

2023-07-20 13:14| 来源: 网络整理| 查看: 265

之前,客户向我们投诉在其站点老遇到这个问题:

ASP.NET4.0错误:Operation is not valid due to the current state of the object_ASP.NET4 Max Http Fi 

这是我第一次遇到这个奇怪的错误提示信息,幸好客户提供了错误日志。

 

2012-08-02 10:47:15,860 [22] ERROR Logger - Operation is not valid due to the current state of the object.

SOURCE: System.Web

TARGETSITE: Void ThrowIfMaxHttpCollectionKeysExceeded()

STACKTRACE: at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()

at System.Web.HttpValueCollection.Add(HttpCookieCollection c)

at System.Web.HttpRequest.FillInParamsCollection()

at System.Web.HttpRequest.GetParams()

at System.Web.HttpRequest.get_Params()

at Accela.ACA.Web.Component.AppSpecInfoTableEdit.GetValueFromHttp(Boolean isAdding, Int32 controlloop, String suffix, String prefix, Int32 groupIndex)

at Accela.ACA.Web.Component.AppSpecInfoTableEdit.GetControlValue(Int32 groupIndex, String prefix, Int32 itemIndex, Int32 rowIndex, String suffix, Boolean isGetRealRowIndex)

at Accela.ACA.Web.Component.AppSpecInfoTableEdit.ShowAppSpecInfoGroup(AppSpecificTableModel4WS appInfoTable, Int32 groupIndex, PlaceHolder phCurrentAppInfoTable, String prefix)

at Accela.ACA.Web.Component.AppSpecInfoTableEdit.Repeater_ItemDataBound(Object sender, DataListItemEventArgs e)

at System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e)

at System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem)

at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource)

at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)

at System.Web.UI.WebControls.BaseDataList.DataBind()

at Accela.ACA.Web.Component.AppSpecInfoTableEdit.Display()

at Accela.ACA.Web.Cap.CapEdit.InitAppSpecTable(String value, CapModel4WS capModel)

at Accela.ACA.Web.Cap.CapEdit.LoadPage(PageModel customPage, CapModel4WS capModel)

at Accela.ACA.Web.Cap.CapEdit.BindPageflowGroup(CapModel4WS capModel4WS, PageFlowGroupModel pageflowGroup)

at Accela.ACA.Web.Cap.CapEdit.OnInit(EventArgs e)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

从这段日志去分析,好像是ASP.NET Runtime有意抛出来,也就是说我们应该是违反了.NET Framework的某些规则才导致成这样。后来我就在网上搜索,找到了根本原因:这是由于NET Framework V4.0在2011年12月29号发布的一个更新引起的,具体的详细情况和解决思路,请参考下面这篇文章:

ASP.NET MS11-100: how can I change the limit on the maximum number of posted form values?

http://stackoverflow.com/questions/8684049/asp-net-ms11-100-how-can-i-change-the-limit-on-the-maximum-number-of-posted-for

 

解决思路:



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3